Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
Getting tab icon with chrome extension and sending it to Flask [JS] [Python]

I'm trying to grab the current tab's icon using Chrome's API and send it via a request:

function sendRequest(update, tab){
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function () {
        if (this.readyState == 4 && this.status == 200) {
            console.log(this.responseText);
        }
    };

    icon = "";
    url = "";

    if (tab.status == 'complete')
        icon = tab.favIconUrl;
        url = tab.url;
    
    formD = new FormData();
    formD.append("url", url);
    formD.append("ic_link", icon);
    
    xhttp.open("POST", "Python_server####/send_url");
    xhttp.send(formD);
}

However, the favicon URL is always either blank or undefined. I also tried accessing the link directly with document.getElementById("shortcut icon").href but I'm not sure if that's legal. Any ideas?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

tab.favIconUrl property is only available if extension has tabs or activeTab permission. Also it is empty string "" if the tab is in loading state

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda